package com.ruoyi.account.service.impl;

import com.ruoyi.account.service.IMonthlyKpiService;
import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.enums.DataSourceType;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.db.domain.MonthlyKpiInfo;
import com.ruoyi.db.mapper.MonthlyKpiMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * 月kpiService业务层处理
 * 
 * @author ruoyi
 * @date 2024-11-08
 */
@Service
@DataSource(DataSourceType.SLAVE)
public class MonthlyKpiServiceImpl implements IMonthlyKpiService 
{
    @Autowired
    private MonthlyKpiMapper monthlyKpiMapper;

    /**
     * 查询月kpi
     * 
     * @param id 月kpi主键
     * @return 月kpi
     */
    @Override
    public MonthlyKpiInfo selectMonthlyKpiById(Long id)
    {
        return monthlyKpiMapper.selectMonthlyKpiById(id);
    }

    /**
     * 查询月kpi列表
     * 
     * @param monthlyKpi 月kpi
     * @return 月kpi
     */
    @Override
    public List<MonthlyKpiInfo> selectMonthlyKpiList(MonthlyKpiInfo monthlyKpi)
    {
        return monthlyKpiMapper.selectMonthlyKpiList(monthlyKpi);
    }

    /**
     * 查询月kpi列表
     *
     * @param monthlyKpi 月kpi
     * @return 月kpi
     */
    @Override
    public List<Map<String, Object>> selectMonthlyKpiMapList(MonthlyKpiInfo monthlyKpi)
    {
        return monthlyKpiMapper.selectMonthlyKpiMapList(monthlyKpi);
    }



    /**
     * 修改月kpi
     *
     * @param monthlyKpi 月kpi
     * @return 结果
     */
    @Override
    public int updateMonthlyKpi(MonthlyKpiInfo monthlyKpi)
    {
        monthlyKpi.setUpdateTime(DateUtils.getNowDate());
        return monthlyKpiMapper.updateMonthlyKpi(monthlyKpi);
    }


}
